//written by cms
#include<bits/stdc++.h>
using namespace std;
int main() 
{
	int a;
	cin >> a;
	cout << a%1000%100%10 << a %1000%100/10 << a %1000/100 << a/1000 ;
	return 0;
}


